package com.cd.card.domain;

import com.cd.common.domain.BaseDomain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Data
@Table(name = "cd_card",
        indexes = {
                @Index(name = "idx_card_level", columnList = "level"),
                @Index(name = "pri_card_id", columnList = "card_id")})
@NoArgsConstructor
@AllArgsConstructor
public class LqqCard extends BaseDomain {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "card_id")
    @Schema(title = "卡牌id")
    //八位数命名 三星的3开头 如30000001
    private Long cardId;

    @Column(name = "card_name")
    @Schema(title = "卡牌名称")
    private String cardName;

    @Column(name = "level",columnDefinition = "TINYINT")
    @Schema(title = "卡牌星级，卡牌等级")
    private int level;

    @Schema(title = "卡牌所在版本，第几代卡牌，可能用不上，有创建时间 default常驻卡 ")
    @Column(name = "generation")
    private Long generation;

    @Schema(title = "卡牌版本，默认为1，除非后续有升级。升级后的卡牌代数叠加，但是新实体，以创建时间为准")
    @Column(name = "version")
    private String version;

    @Schema(title = "卡牌创建时间")
    @Column(name = "create_time")
    private Date createTime;

    @Schema(title = "卡牌标识，是否绝版或下线，或缺货")
    @Column(name = "status")
    private String status;

    //score
    @Schema(title = "评分")
    @Column(name = "score")
    private Long score;

}
